package com.xci.edu.module.foreground.pc.train.core;

import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

@Component
public class StudentWebConfig implements WebMvcConfigurer {
    @Resource
    private StudentrHandlerInterceptor studentrHandlerInterceptor;

    /**
     * 配置请求拦截器
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 拦截api权限判断
        registry.addInterceptor(studentrHandlerInterceptor)
                .addPathPatterns("/train/**")
                .excludePathPatterns("/train/login","/train/loginHandle");
    }
}